package com.ye.service.impl;

import com.ye.domain.Comments;
import com.ye.mapper.CommentsMapper;
import com.ye.service.CommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ComentsServiceImpl implements CommentsService {

    @Autowired
    private CommentsMapper commentsMapper;

    @Override
    public List<Comments> getAllCommentsByMusicId(Integer musicId) {
        return commentsMapper.getAllCommentsByMusicId(musicId);
    }

    @Override
    public List<Comments> getFirsts(Long musicId) {
        return commentsMapper.getFirsts(musicId);
    }

    @Override
    public List<Comments> getChilds(Long commentsId) {
        List<Comments> childs = commentsMapper.getChilds(commentsId);
        return childs;
    }

    @Override
    public void firstComment(Long musicId, String content, Long userId) {
        commentsMapper.firstComment(musicId,content,userId);
    }

    @Override
    public void reply(Long musicId, Long parentId, String content, Long userId) {
        commentsMapper.reply(musicId,parentId,content,userId);
    }
}
